# -*- coding: utf-8 -*-


from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()


class User(Base):
    __tablename__ = 'user'

    id = Column(Integer, primary_key=True)
    name = Column(String(20))

engine = create_engine('mysql+mysqlconnector://root:@localhost:3306/test')

DBSession = sessionmaker(bind=engine)
session = DBSession()
